#!/usr/bin/env python
import string
from dict.drugs_dict import drugs
__author__ = 'gogo'

__version__ = '0.0.1'

letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def clear_punctuation(user_string):
    """
    clear punctuation and convert to lower case
    :param user_string:
    """
    # return user_string.translate(self.table, string.punctuation)
    # return ''.join(ch for ch in user_string if ch not in self.exclude)
    for c in string.punctuation:
        user_string = user_string.replace(c, " ")

    return user_string.lower()


bda_drugs = set()

for letter in letters:
    print letter

    with open('bda1/'+letter+'.txt') as f:
        for line in f:
            part = line.split('||')
            bda_drugs.add(clear_punctuation(part[0].strip()).split()[0])


for dr in sorted(list(drugs | bda_drugs)):
    print " "*4 + "'" + dr + "',"



# driver = webdriver.Firefox()


